// function printId(id: number | string) {
//   console.log('Your ID is:' + id)
//   console.log(id.toupperCase())
// }

// printId(1)
// printId('2')

function welcomePeople(x: string[] | string) {
  if (Array.isArray(x)) {
    console.log('Hello, ' + x.join(' and '));
  } else {
    console.log('Hello lonely traveler' + x);
  }
}

welcomePeople('A')
welcomePeople(['a', 'b', 'c'])

function getFirstThree(x: number[] | string) {
  return x.slice(0, 3)
}

getFirstThree('hello')
getFirstThree([1, 23, 4, 5])
